/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package Entity;

import java.io.Serializable;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.Lob;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 *
 * @author Acer
 */
@Entity
@Table(name = "tb_Tours", catalog = "East2West_TourAndTravel", schema = "dbo")
@NamedQueries({
    @NamedQuery(name = "TbTours.findAll", query = "SELECT t FROM TbTours t"),
    @NamedQuery(name = "TbTours.findByTourID", query = "SELECT t FROM TbTours t WHERE t.tourID = :tourID"),
    @NamedQuery(name = "TbTours.findByTourName", query = "SELECT t FROM TbTours t WHERE t.tourName = :tourName"),
    @NamedQuery(name = "TbTours.findByTourPrice", query = "SELECT t FROM TbTours t WHERE t.tourPrice = :tourPrice"),
    @NamedQuery(name = "TbTours.findByTourFrom", query = "SELECT t FROM TbTours t WHERE t.tourFrom = :tourFrom"),
    @NamedQuery(name = "TbTours.findByTourTo", query = "SELECT t FROM TbTours t WHERE t.tourTo = :tourTo"),
    @NamedQuery(name = "TbTours.findByTourDays", query = "SELECT t FROM TbTours t WHERE t.tourDays = :tourDays"),
    @NamedQuery(name = "TbTours.findByTourImage", query = "SELECT t FROM TbTours t WHERE t.tourImage = :tourImage"),
    @NamedQuery(name = "TbTours.findByDiscount", query = "SELECT t FROM TbTours t WHERE t.discount = :discount"),
    @NamedQuery(name = "TbTours.findByDeleteSTT", query = "SELECT t FROM TbTours t WHERE t.deleteSTT = :deleteSTT")})
public class TbTours implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "tour_ID", nullable = false)
    private Integer tourID;
    @Column(name = "tour_Name", length = 50)
    private String tourName;
    @Column(name = "tour_Price", precision = 53)
    private Double tourPrice;
    @Column(name = "tour_From", length = 50)
    private String tourFrom;
    @Column(name = "tour_To", length = 50)
    private String tourTo;
    @Column(name = "tour_Days")
    private Integer tourDays;
    @Lob
    @Column(name = "tour_Description", length = 2147483647)
    private String tourDescription;
    @Column(name = "tour_Image", length = 50)
    private String tourImage;
    @Column(name = "discount", precision = 53)
    private Double discount;
    @Column(name = "deleteSTT")
    private Integer deleteSTT;
    @JoinColumn(name = "cat_ID", referencedColumnName = "cat_ID")
    @ManyToOne
    private TbCategory catID;
    @OneToMany(mappedBy = "tourID")
    private List<TbOrder> tbOrderList;
    @OneToMany(mappedBy = "tourID")
    private List<TbPhotoGallery> tbPhotoGalleryList;

    public TbTours() {
    }

    public TbTours(Integer tourID) {
        this.tourID = tourID;
    }

    public Integer getTourID() {
        return tourID;
    }

    public void setTourID(Integer tourID) {
        this.tourID = tourID;
    }

    public String getTourName() {
        return tourName;
    }

    public void setTourName(String tourName) {
        this.tourName = tourName;
    }

    public Double getTourPrice() {
        return tourPrice;
    }

    public void setTourPrice(Double tourPrice) {
        this.tourPrice = tourPrice;
    }

    public String getTourFrom() {
        return tourFrom;
    }

    public void setTourFrom(String tourFrom) {
        this.tourFrom = tourFrom;
    }

    public String getTourTo() {
        return tourTo;
    }

    public void setTourTo(String tourTo) {
        this.tourTo = tourTo;
    }

    public Integer getTourDays() {
        return tourDays;
    }

    public void setTourDays(Integer tourDays) {
        this.tourDays = tourDays;
    }

    public String getTourDescription() {
        return tourDescription;
    }

    public void setTourDescription(String tourDescription) {
        this.tourDescription = tourDescription;
    }

    public String getTourImage() {
        return tourImage;
    }

    public void setTourImage(String tourImage) {
        this.tourImage = tourImage;
    }

    public Double getDiscount() {
        return discount;
    }

    public void setDiscount(Double discount) {
        this.discount = discount;
    }

    public Integer getDeleteSTT() {
        return deleteSTT;
    }

    public void setDeleteSTT(Integer deleteSTT) {
        this.deleteSTT = deleteSTT;
    }

    public TbCategory getCatID() {
        return catID;
    }

    public void setCatID(TbCategory catID) {
        this.catID = catID;
    }

    public List<TbOrder> getTbOrderList() {
        return tbOrderList;
    }

    public void setTbOrderList(List<TbOrder> tbOrderList) {
        this.tbOrderList = tbOrderList;
    }

    public List<TbPhotoGallery> getTbPhotoGalleryList() {
        return tbPhotoGalleryList;
    }

    public void setTbPhotoGalleryList(List<TbPhotoGallery> tbPhotoGalleryList) {
        this.tbPhotoGalleryList = tbPhotoGalleryList;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (tourID != null ? tourID.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof TbTours)) {
            return false;
        }
        TbTours other = (TbTours) object;
        if ((this.tourID == null && other.tourID != null) || (this.tourID != null && !this.tourID.equals(other.tourID))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "Entity.TbTours[tourID=" + tourID + "]";
    }

}
